package com.example.design.bilibili.mediator;

public class Alarm extends Colleague{

    public Alarm(Mediator mediator, String name) {
        super(mediator, name);
        //在创建Alarm同事对象时，将自己放入到ConcreteMediator对象中（集合）
        mediator.Register(name,this);
    }

    public void sendAlarm(int stateChange){
        sendMessage(stateChange);
    }

    @Override
    public void sendMessage(int stateChange) {

        //调用中介者对象的getMessage
        this.getMediator().GetMessage(stateChange,this.name);
    }
}
